<template>
  <div class="all_into_page page_scroll">

    <!-- 搜索区域 开始 -->
    <!-- <div class="search_box">
      <el-form :model="searchForm" :inline="true" size="small">
        <el-form-item label="手机号码：">
          <el-input v-model="searchForm.mobile"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="getList()">查询</el-button>
        </el-form-item>
      </el-form>
    </div> -->
    <!-- 搜索区域 end -->

    <!-- 列表区域 开始 -->
    <div class="">
      <el-table class="el_table" :data="dataList" border>
        <el-table-column label="id" type="index" width="80" align="center"></el-table-column>
        <el-table-column label="文件名称" prop="name"></el-table-column>
        <el-table-column label="日期" prop="createDate"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="{row}">
            <el-button type="primary" size="mini" @click="downloadFile(row)">下载</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- <BasePagination v-model="page" :total="totalCount" @change="pageOnChange" /> -->
    </div>
    <!-- 列表区域 end -->

  </div>
</template>
<script>
import { deepClone, showModal, showToast } from "@/utils/util";
import { GET_DOWNLOAD_LIST } from "@/http/system";
export default {
  data() {
    return {
      searchForm: {},
      page: 1,
      pageSize: 100,
      dataList: [],
      totalCount: 0,
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    // 分页切换事件
    pageOnChange(row) {
      this.page = row.page;
      if (row.pageSize) {
        this.pageSize = row.pageSize;
      }
      this.getList();
    },

    // 获取参数
    getParams() {
      const oParams = {};
      const o = deepClone(this.searchForm);
      oParams.size = this.pageSize;
      oParams.paramObject = o;
      return oParams;
    },

    // 获取列表
    getList() {
      const oParams = {}
      GET_DOWNLOAD_LIST(oParams).then((res) => {
        let list = res.data || [];
        this.dataList = list;
      });
    },

    // 下载文件
    downloadFile(row){
      if(!row.requestUri){
        return false;
      }
      window.location.href = row.requestUri
    }

  },
};
</script>
<style lang="scss" scoped>
.all_into_page {
  padding: 20px;
}
</style>
  